/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package factory;

import org.newdawn.slick.Image;
import org.newdawn.slick.SlickException;


/**
 *
 * @author wida46984148
 */
public class Naves {

    private static ArchiuConf NW;
    private static ArchiuConf NE;

    public static NauBase nausWida(String ref) throws SlickException{
        NauBase nb = null;
        if (NW == null) {
            NW = Conf.getUnitats();
        }
        if(ref.equals("Pistoler")){
            System.out.println(NW.getPropietatInt("vidaPistoler"));
        }else if (ref.equals("nave2")){
            //System.out.println("nave 2");

            // estaran en el archivo cnf
            Image img = new Image("src/data/plane.png");
            Image exp = new Image("src/data/explosion.jpg");
            Image st = new Image("src/data/shot.jpg");

            nb = new NauWida1(3, 3, new MoveShoot(10, st), img, 200, 200, exp);

        }else if(ref.equals("nave3")){
            Image exp = new Image("src/data/explosion.jpg");
            Image st = new Image("src/data/shot2.png");
            Image img = new Image("src/data/planeW.png");

            nb = new NauWida1(30, 30, new MoveShoot(10, st), img, 20, 0, exp);
        }
        return nb;
    }

    public static NauBase nausEnemigues(String ref) throws SlickException{
        NauBase nb = null;
        if (NE == null) {
            NE = Conf.getUnitats();
        }
        if(ref.equals("Pistoler")){
            System.out.println(NW.getPropietatInt("vidaPistoler"));
        } else if (ref.equals("nave0")){
            Image exp = new Image("src/data/explosion.jpg");
            Image st = new Image("src/data/shot.jpg");
            Image img = new Image("src/data/planeE0.png");



            //nb = new NauEnemiga0(10, 10, null, img, 150, -100, exp);
            // a -9 funciona uno menos no ola??
            nb = new NauEnemiga0(10, 10, new shootE(5, st), img, (int)(Math.random()*300+1), -99, exp);
        }
        return nb;



    }

}